<template>
    <div class="diyheader">
			<div class="d-flex a-center j-center " style="height: 50px">
				<!-- <img class="d-flex" src="@/assets/logo.png" style="height: 40px; cursor: pointer" @click="homePage" /> -->
				<!-- <img v-if="torf" class="d-flex" src="@/assets/img/fanhui2.png" style="height: 25px; cursor: pointer" @click="homePage" /> -->
				<a @click="homePage" class="gohomebtn">首页</a>
			</div>

			<div class="d-flex a-center j-center">
				<div class="order d-flex a-center j-center mr-15">
					<div class="el-icon-s-order pointer font-md3 mr-1" style="color: #c6c6c6"></div>
					<span class="pointer font-md text-white" @click="or()">我的订单</span>
				</div>

				<!-- <div @click="Tologin()">
					<el-avatar icon="el-icon-user-solid pointer" style="margin-top: 5px"></el-avatar>
				</div> -->
			</div>
		</div>
</template>
<script>
    export default{
        name: 'Header',
		components: {},

		data() {
          
			return {
				torf:false
             
			};
		},
		computed: {
			
		},
		created() {
			
		},
		mounted() {
			if(this.$route.path == '/'){
					this.torf=false
				}else{
					this.torf=true
           
				}
		},

		methods: {		
			homePage() {
			
				if(this.$route.path == '/'){
					location.reload();
				}else{
					this.$router.push({
                    	path: '/',
                	});
				}
         
			},
		

			Tologin() {
				this.$router.push({
					path: '/login',
				});
			},
            or() {
				this.$router.push({
					path: '/Order',
				});
			}
		

		},
	
    }
</script>

<style scoped>
	.diyheader{
		font-size: 14px;
		display: flex;
		background-color: #191a20;
		overflow: auto;
		justify-content: space-between;
		padding:0 10%;
		width:100vw;
	}
		
	.gohomebtn{
		color:#fff;
		font-size:1rem;
		background: none;
		border: none;
		font-weight:400;
	}
    .home {
		margin: 0;
		padding: 0;
		box-sizing: border-box;
	}
</style>